<template>
<div>
  <el-descriptions title="管理员信息" direction="vertical" :column="4" border>
    <el-descriptions-item label="用户名">{{ adminInfo.adminName }}</el-descriptions-item>
    <el-descriptions-item label="个性签名">{{ adminInfo.signature }}</el-descriptions-item>
    <el-descriptions-item label="手机号">18100000000</el-descriptions-item>
    <el-descriptions-item label="居住地" :span="2">42栋</el-descriptions-item>
    <el-descriptions-item label="身份">
      <el-tag size="small">管理员</el-tag>
    </el-descriptions-item>
    <el-descriptions-item label="创建时间" >{{ adminInfo.createTime }}</el-descriptions-item>
    <el-descriptions-item label="最近登录" >{{ adminInfo.updateTime }}</el-descriptions-item>
    <el-descriptions-item label="联系地址">华东交通大学北区42栋</el-descriptions-item>
  </el-descriptions>
</div>
</template>

<script>
export default {
  name: 'info',
  data () {
    return {
      adminInfo: {
        adminName: '',
        signature: '',
        headPortrait: '',
        page: 1,
        pageSize: 1,
        updateTime: '',
        createTime: ''
      }
    }
  },
  methods: {
    // 用于改变面包屑导航栏
    changeBread () {
      document.getElementById('first').innerHTML = '管理员'
      document.getElementById('second').innerHTML = '个人信息'
      document.getElementById('separate_1').innerHTML = '/'
      document.getElementById('separate_2').innerHTML = '/'
    },
    async getAdminInfo () {
      this.adminInfo.adminName = window.sessionStorage.getItem('username')
      const { data: res } = await this.$http.post('/admin/selectAdminByAccurate/', this.adminInfo)
      // console.log(res)
      // console.log()
      this.adminInfo = res.data.list[0]
      // window.sessionStorage.setItem('adminInfo', res.data.list[0])
      // console.log(this.adminInfo)
    }
  },
  mounted () {
    this.changeBread()
    this.getAdminInfo()
  }
}
</script>

<style scoped>

</style>
